#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import configparser


class PJDogConfig(object):
    def __init__(self, config):
        cf = configparser.ConfigParser()
        cf.read(config)

        self.task_file = cf.get('data', 'task_file')
        self.record_file = cf.get('data', 'record_file')
        self.filter_file = cf.get('data', 'filter_file')
        self.login_url = cf.get('data', 'login_url')
        self.request_url = cf.get('data', 'request_url')
        try:
            self.post_data = eval(cf.get('data', 'post_data'))
        except Exception as e:
            print(e)
            self.post_data = None
        self.proxy = eval(cf.get('data', 'proxy'))
        self.data_path = cf.get('data', 'data_path')
        self.min_size = cf.getint('data', 'min_size')
        self.oper_type = cf.get('data', 'oper_type')


class PJDogSession(object):
    def __init__(self, session, headers, proxy):
        self.session = session
        self.headers = headers
        self.proxy = proxy
